#!/usr/bin/env python
# -*- coding:utf-8 -*-

#---------------------------->for, range<----------------------------------

# name = ["芍药花","夏天","小猫咪","豆豆"]
# count = 0
# for i in name:
#     print(count,i)
#     print(i)
#     for j in i:
#         print(j)
#     count += 1

# name = ["芍药花","夏天","小猫咪","豆豆"]
# len_name = len(name)
# for index in range(0,len_name):
#     print(index,name[index])

#---------------------------》删除del/remove/pop《-------------------------------
# names = ["白色","拿坡里黄","柠檬黄","马尔代夫","淡黄"]
# del names[0]
# print(names)
#
# new_names2 = names.pop()
# print(new_names2)
# print(names)
#
# names.remove("马尔代夫")
# print(names)

# colors = ["奶白色","柠檬黄","深蓝"]
# colors.pop(1)
# print(colors)


#--------------------->往列表中添加元素，append/insert<-----------------------

# colors = ["白色","拿坡里黄","柠檬黄","马尔代夫","淡黄"]
# colors.append("中黄")
# print(colors)
#
# colors.insert(1,"桔黄")
# print(colors)

# flowers = []
# flowers.append("向日葵")
# print(flowers)

#--------------------》删除整个列表《-----------------------

# names = ["白色","拿坡里黄","柠檬黄","马尔代夫","淡黄"]
# names.clear()
# print(names)

#--------------------------》排序/反转，sort/reverse《----------------------------

# grades = [123, 90, 77, 89, 32]
# grades.reverse()
# print(grades)
# grades.sort()
# print(grades)

#---------------------------->往列表添加列表或字符串 extend<------------------------------------

# list = ["李金花","菜根花","大强"]
# list1 = ["糖醋排骨","可乐鸡翅","柠檬鸡爪"]
# st = "小敏在家里炒菜把厨房给烧了！！！！"
#
# list.extend(list1)
# print(list)
# list.extend(st)
# print(list)

#----------------------------------------------》输入数字选项，输出对应的内容《-----------------------------------------
cars = ["小汽车","火车","货车","自行车"]
# choice = input("请输入您选择的商品编号：")
# num = int(choice)
# print("%d: %s"%(num,cars[num-1]))
#
# len_car = len(cars)
# for index in range(0,len_car):
#     print("%d: %s"%(index,cars[index]))
# num = 1
# for i in cars:
#     print("%d: %s"%(num,i))
#     num += 1


#-----------------------------》把列表里的元素使用符号连接起来《---------------------------------

num = [11,22,33,44]
for i in range(0,len(num)):
    num[i] = str(num[i])

v1 = "_".join(num)
print(v1)
#注：join只有在num是字符串的情况下才能使用